import React from "react";
import { Navigate } from "react-router-dom";

const Login = React.lazy(() => import("./pages/Login"));
const Test = React.lazy(() => import("./pages/Test"));
const Register = React.lazy(() => import("./pages/Register"));

const routes = [
  {
    path: "/",
    element: <Navigate to="/login" replace />,
  },
  {
    path: "/login",
    element: (
      <React.Suspense fallback={<div>Loading...</div>}>
        <Login />
      </React.Suspense>
    ),
  },
  {
    path: "/test",
    element: (
      <React.Suspense fallback={<div>Loading...</div>}>
        <Test />
      </React.Suspense>
    ),
  },
  {
    path: "/register",
    element: (
      <React.Suspense fallback={<div>Loading...</div>}>
        <Register />
      </React.Suspense>
    ),
  },
];

export default routes;